from sqlmodel import SQLModel, Field
from typing import Optional

class ApiLogCreate(SQLModel):
    uid: int = Field(description="用户ID")
    path: str = Field(max_length=255, description="请求路径")
    method: str = Field(max_length=10, description="请求方法")
    status_code: int = Field(description="响应状态码")
    process_time: float = Field(description="处理时间（秒）")
    request_body: Optional[str] = Field(default=None, description="请求体")
    response_body: Optional[str] = Field(default=None, description="响应体")
    ip_address: Optional[str] = Field(default=None, description="IP地址")